package Test;

import java.util.Scanner;

public class Fib {
    public static int fib(int a) {
        int i = 0;//记录层数
        int ret=0;//记录结果
        for (i = 0; i < a; i++) {
            if (a == 1 || a == 2) {
                ret=1;
                break;
            }else if(a>2){
                ret=1;
                ret=(a-2)*ret+(a-3)*ret;
                break;
            }else{
                System.out.println("输入的数不在范围内！");
                break;
            }
        }
        return ret;
    }
    public static void main(String[] args) {
        Scanner sc=new Scanner(System.in);
        int n=sc.nextInt();//要计算第几项
        System.out.println(fib(n));
    }
}
